<?php
require_once(dirname(__FILE__) . "/../viae/converter.php");
require_once(dirname(__FILE__) . "/assert.php");

echo "cm to pixels" . "<br/>";
assertEquals(1889.763779528, cmToPixel(50));
assertEquals(5669.291338583, cmToPixel(150));
assertEquals(1908.661417323, cmToPixel(50.5));
assertEquals(188.976377953, cmToPixel(5));
assertEquals(150, cmToPixel(3.96875));

echo "<br/>";
echo "<br/>";
echo "<br/>";

echo "pixels to cm" . "<br/>";
assertEquals(pixelToCm(1889.763779528), 50);
assertEquals(pixelToCm(5669.291338583), 150);
assertEquals(pixelToCm(1908.661417323), 50.5);
assertEquals(pixelToCm(188.976377953), 5);
assertEquals(pixelToCm(150), 3.96875);

echo "<br/>";
echo "<br/>";
echo "<br/>";

echo "cm to inch" . "<br/>";
assertEquals(19.68503935, cmToInch(50));
assertEquals(59.05511805, cmToInch(150));
assertEquals(19.881889744, cmToInch(50.5));
assertEquals(1.968503935, cmToInch(5));
assertEquals(7.755905504, cmToInch(19.7));

echo "<br/>";
echo "<br/>";
echo "<br/>";

echo "inch to cm" . "<br/>";
assertEquals(inchToCm(19.7), 50.038000051);
assertEquals(inchToCm(59.1), 150.114000153);
assertEquals(inchToCm(19.9), 50.546000052);
assertEquals(inchToCm(2), 5.080000005);
assertEquals(inchToCm(7.8), 19.81200002);

?>